Results 1 to 10 of 10

Thread: Trigger issue?

  1. #1

    Default Trigger issue?

    I have a spot with two triggers. The first trigger launches the objective itself, the second trigger if touched by an enemy will stop it. Both triggers are in the same place. Here's the issue. I test with Modders MoHAA, so I run two instances and host and join my own game. Could that be causin my problem?

    My problem is, both client 0 and client 1 can initiate the objective, but ONLY client 1 can stop it. Client 0 on either team can't stop it, client 1 on either team can stop it. Why client 1? Why not both?

  2. #2
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    still don't get it O.o

  3. #3

    Default

    Well, trigger 1 is an area that either team can capture. But only when no enemies are in the area. If an enemy is in the area the capture stops when trigger 2 is activated.

    Trigger 1 always works, but trigger 2 only works for client 1, it doesn't work for the host (me-client 0)

  4. #4
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    both trigger are in the same place and same size ?
    if yes then use only i trigger to handle player touches and delete the other.

  5. #5

    Default

    I tried this but it more or less broke the capture trigger when I did.

  6. #6
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Why not just use the 1 trigger, and add a check to see if enemy team is within a certain radius of the area or trigger?

    So if there is an enemy player within the area, you cant capture it ( or re-capture it ).
    Only when there is no enemy there, it can either change to the capture players team, or stay the same.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  7. #7

    Default

    Purple, how would I check for an enemy like that? The only thing I could think is to do like

    if(local.player.dmteam == allies) {
    //capture stuff
    } else
    //block capture stuff

    end

    But I don't want only one team to be able to capture.

  8. #8
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Hey

    You could do something similar to this,
    just to give you an example

    local.trigger = trigger_multiple
    local.trigger.origin = ( 0 0 0 ) // bla bla lol
    ...
    ...
    ..
    /// ^^ do the rest
    
    while(1)
    {
        local.trigger waittill triggered   // waits until triggered
    
        /// once triggered
        local.trigger nottriggerable
        local.player = parm.other
    
        local.found = waitthread check_enemy local.player local.trigger.origin
    
        if(local.found)
        {
            /// enemy is near, cant capture
        }
        else
        {
            /// can capture ( or re-capture ), you can either do everything here, or best is to call another function from here.
            /// so you can check to see which team is currently in control of the area
            /// something like level.capture.team = allies or axis or whatever. Do not forget a case for the first time round
    
            if(level.capture.team == NIL)
            {
                level.capture.team = local.player.dmteam
            }
    
            /// if one team, swap,
            if(level.capture.team == "axis" && local.player.dmteam != "axis")
            {
                level.capture.team == "allies"
            }
            else if(level.capture.team == "allies" && local.player.dmteam != "allies")
            {
                level.capture.team == "axis"
            }
        }
    
        wait 1  /// change this how you like
    
        local.trigger triggerable
    }
    
    //// check enemy function
    check_enemy local.player local.origin:
    
    /// local.player is the one who triggered it
    /// local.origin is the triggers origin
    /// if enemy is found, return 1, else 0;
    
    // set radius
    local.radius = 200.00 * 200.00
    
    for(local.i = 1; local.i <= $player.size; local.i++)
    {
        local.player_check= $player[local.i]
        local.distance =  (local.player_check.origin - local.origin) * (local.player_check.origin - local.origin)
    
        if(local.distance <= local.radius && local.player_check.dmteam != local.player.dmteam)
        {
            // enemy is within distence
            end 1;
        }
    
    }
    
    end 0;

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  9. #9
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    I meant what purple exactly did.
    Now i have more time to more lazy again :@

  10. #10

    Default

    Thanks guys! I'll be trying this in a couple hours.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •